|
Protocols
- Initiator.class
If a QUERY-IF/QUERY-REF message arrives
if replies in one of the following way:
- ProtocolTest.class
- ComplexInitiator.class
This example shows the usage of two behaviours
provided by JADE that implement the 'fipa-query' protocol and the 'fipa-request'
protocol.
.
This agent plays initiator role in a conversation
following standard 'fipa-request' or 'fipa-query' protocol. It sends a
REQUEST, a QUERY-IF or a QUERY-REF to a set of agent passed as argument.
- Responder.class
The companion agent of Initiator.This
agent plays responder role in 'fipa-request' and 'fipa-query' protocol
according to the messsage received.
If a REQUEST arrives it answers
random in one of the following way:
- send an AGREE message and
then an INFORM message
- send an AGREE message and
then a FAILURE message
- send an AGREE message and
then no message (in this case the Initiator agent will wait forever for
the INFORM/FAILURE message)
- send an AGREE message and
then an out of sequence message
- send an INFORM message
- send a REFUSE message
- send a NOT_UNDERSTOD message
- send an out of sequence
message
- send no message
- sends a NOT_UNDERSTOOD
message
- sends a REFUSE message
- sends a FAILURE message
- sends an INFORM message
- sends an out of sequence
message
- sends no message
This example using the inProcess interface
permits the user to launch a JADE main container with one Initiator
agent and set of Responders,
For examples the following command
line:
java examples.protocol.ProtocolTester
receiver1 receiver2 receiver3
start an Initiator agent sending message
to the three Responders: receiver1, receiver2 and receiver3.
This example shows how to use the AchieveREInitiator
protocol and register another initiator behaviour to handle one of the
states of the protocol.
JADE is a trademark of CSELT. JADE has been developed jointly by CSELT and the Computer Engineering Group of the University of Parma